package com.xiaomimall.back.ADV;

import com.xiaomi.back.dao.Advertisement.AdvertisementBackDao;
import com.xiaomi.pojo.Advertisement;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class ADv {
    private ApplicationContext context ;

    @Before
    public void init() {
        context = new ClassPathXmlApplicationContext("spring-config-all.xml") ;
    }
    @Test
    public void getadv(){
        List<Advertisement> advertisements=context.getBean(AdvertisementBackDao.class).getADV(8);
        for(Advertisement advertisement:advertisements){
            System.out.println(advertisement.getComname());
        }
    }
}
